<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form  action="<?php  echo url_for('user/loginDone') ?>" method="post"  <?php  $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2" align = "right">
          <?php echo $form->renderHiddenFields(false) ?>
          &nbsp;<a href="<?php echo url_for('user/index') ?>">Back to list</a>
          <input type="submit" value="Login"/>
        </td>
      </tr>
      <tr><td colspan = "2" align = "right"><?php echo link_to('Create new account','user/new')?></td></tr>
    </tfoot>
    <tbody>
    <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['user_name']->renderLabel() ?></th>
        <td>
          <?php echo $form['user_name']->renderError() ?>
          <?php echo $form['user_name'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['pws']->renderLabel() ?></th>
        <td>
          <?php echo $form['pws']->renderError() ?>
          <?php echo $form['pws'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
